import zmail

with open(r".\baidu.html", "r", encoding="utf-8") as f:
    my_html = f.read()

# 你的邮件内容
mail_content = {
    "subject":"success!",  # 邮件主题
    "content_html": my_html,
    # "content_text":"This message from zmail", # 邮件内容
    "attachments":r".\my_test.xlsx",  # 邮件附件
}

server = zmail.server("2783226718@qq.com", "dhrzoyadonwodfgf")
server.send_mail(["2783226718@qq.com"], mail_content)